package com.tarena.lbs.basic.web.globExceptionHandler;

import com.tarena.lbs.base.protocol.exception.BusinessException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import com.tarena.lbs.base.protocol.model.Result;

@Slf4j
@RestControllerAdvice
public class GlobExceptionHandler {


    @ExceptionHandler
    public Result handleException(BusinessException e){
        log.error("业务异常",e.getMessage());
        return Result.fail();
    }
}
